package com.gupao.demo.annotation.componentScan;import com.gupao.project.controller.MyController;import com.gupao.project.entity.Person;import org.springframework.context.annotation.ComponentScan;import org.springframework.context.annotation.Configuration;import org.springframework.context.annotation.FilterType;import org.springframework.stereotype.Controller;/** * 用includeFilters的时候，一般把默认规则设置为false，useDefaultFilters = false */@Configuration@ComponentScan(value = "com.gupao.project",includeFilters = {//        @ComponentScan.Filter(type = FilterType.ANNOTATION,classes = {Controller.class}),   //只加载有某个注解的类//        @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,classes = {Person.class}),  //只加载某个类        @ComponentScan.Filter(type = FilterType.CUSTOM,classes = {GPTypeFilter.class})        //自定义规则，},useDefaultFilters = false)public class MyConfig {}